Skip to content

Add setOnFlushError method to BraintrustState and HTTPBackgroundLogger#1515

Closed
colinbennettbrain wants to merge 3 commits intomainfrom
onFlushError-logger
Closed

Add setOnFlushError method to BraintrustState and HTTPBackgroundLogger#1515
colinbennettbrain wants to merge 3 commits intomainfrom
onFlushError-logger

Conversation

@colinbennettbrain
Copy link
Copy Markdown
Contributor

  • Added setOnFlushError method to BraintrustState and HTTPBackgroundLogger to manage error callbacks during log flushing.
  • Updated login, initLogger, and initExperiment functions to accept and set the onFlushError callback.
  • Enhanced tests in logger-misc.test.ts to verify the correct wiring of the onFlushError callback during logger initialization and login processes.

…rwritten by SDK defaults in the TypeScript SDK's ObjectFetcher.fetchRecordsFromApi().
- Added `setOnFlushError` method to `BraintrustState` and `HTTPBackgroundLogger` to manage error callbacks during log flushing.
- Updated `login`, `initLogger`, and `initExperiment` functions to accept and set the `onFlushError` callback.
- Enhanced tests in `logger-misc.test.ts` to verify the correct wiring of the `onFlushError` callback during logger initialization and login processes.
@lforst
Copy link
Copy Markdown
Member

Would you mind sharing the use-case behind this change? IMO the onFlushError on initLogger is already more than powerful enough to cover any use-case I could think of.

@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If this PR is still relevant, please leave a comment, push an update, or remove the stale label. Thank you for your contributions!

@github-actions github-actions bot added the stale label Mar 21, 2026
@github-actions
Copy link
Copy Markdown

This pull request was closed because it has been inactive for 21 days (14 days of inactivity before being marked stale, plus 7 additional days). If this PR is still relevant, please feel free to reopen it. Thank you!

@github-actions github-actions bot closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants